package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;

@RestController
@SpringBootApplication
public class RestApplication {

    public static void main(String[] args) {
        SpringApplication.run(RestApplication.class, args);
    }

    @GetMapping("dogs")
    public String dogsById(String id) {
        return "is id " + id;
    }

    @PostMapping("dogs")
    public String addDogs(@PathParam("id") String id, @PathParam("name") String name) {
        return "add gods id = " + id + " name = " + name;
    }

    @PutMapping("dogs/{id}")
    public String updateGods(@PathVariable String id) {
        return "update is id = " + id;
    }

    @DeleteMapping("dogs/{id}")
    public String deleteGods(@PathVariable String id) {
        return "delete is id = " + id;
    }


}
